package ${packageName}.dto;

import com.boss.core.base.dto.BaseDTO;
import ${packageName}.domain.${classInfo.className};
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.Instant;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Objects;
import java.util.Optional;
<#if useLombok>
import lombok.Data;
</#if>
/**
 * ${classInfo.classComment}
 *
 * @author ${authorName} ${.now?string('yyyy-MM-dd')}
 */
@ApiModel("${classInfo.className}DTO")
<#if !!useLombok>
@Data
</#if>
public class ${classInfo.className}DTO extends BaseDTO<String> {
    private static final long serialVersionUID = 1L;
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
    <#list classInfo.fieldList as fieldItem >
    /**
     * ${fieldItem.fieldComment}
     */
    <#if fieldItem.required && fieldItem.fieldName != "id">
    @NotNull
    </#if>
    <#if fieldItem.size gt 0>
    @Size(max = ${fieldItem.size?c})
    </#if>
    @ApiModelProperty(value = "${fieldItem.fieldComment}"<#if fieldItem.exampleValue?exists>, example = "${fieldItem.exampleValue}"</#if> <#if fieldItem.required && fieldItem.fieldName != "id">, required = true</#if>)
    private ${getFieldItemClass(fieldItem.fieldClass)} ${fieldItem.fieldName};

    </#list>

<#if !useLombok>
<#list classInfo.fieldList as fieldItem >
    public ${getFieldItemClass(fieldItem.fieldClass)} get${fieldItem.fieldName?cap_first}() {
        return ${fieldItem.fieldName};
    }
    public void set${fieldItem.fieldName?cap_first}(${getFieldItemClass(fieldItem.fieldClass)} ${fieldItem.fieldName}) {
        this.${fieldItem.fieldName} = ${fieldItem.fieldName};
    }

</#list>
</#if>

</#if>

}

<#function getFieldItemClass(fieldClass)>
    <#if !!longToString && (fieldClass == "Long" || fieldClass == "BigDecimal")>
        <#return "String">
    </#if>
    <#return fieldClass>
</#function>